Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legacy long aggregations #523

Merged
merged 12 commits into from
Jul 25, 2024
Merged

Conversation

bryantpark04
Copy link
Contributor

No description provided.

@bryantpark04 bryantpark04 self-assigned this Jul 24, 2024
@bryantpark04 bryantpark04 force-pushed the bryantp/legacy-long-aggregations branch from f7ab49a to d2419ac Compare July 25, 2024 14:30
@@ -111,15 +112,17 @@ export type GroupByFromType<T, N extends string> = NonNullable<T> extends number
: T extends Array<infer U> ? GroupByFromType<U, N>
: never;

export type AggregationFromType<T> = NonNullable<T> extends number
export type AggregationFromType<T> = NonNullable<T> extends StringLong
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change that adds numerical aggregation support back to long-type properties


declare const representsLong: unique symbol;

export type StringLong = string & { [representsLong]: true };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used a tagged type to disambiguate between string-type properties and strings that represent long-type properties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave a comment in the code here to explain this?

@bryantpark04 bryantpark04 marked this pull request as ready for review July 25, 2024 16:21
Copy link
Contributor

@ssanjay1 ssanjay1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one comment

@bryantpark04 bryantpark04 merged commit e2ab8db into main Jul 25, 2024
7 checks passed
@bryantpark04 bryantpark04 deleted the bryantp/legacy-long-aggregations branch July 25, 2024 20:33
@ericanderson
Copy link
Member

Fixes #324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants